<?php

/**
 * WidgetPosition form base class.
 *
 * @method WidgetPosition getObject() Returns the current form's model object
 *
 * @package    berta-s
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedInheritanceTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseWidgetPositionForm extends ExpandoForm
{
  protected function setupInheritance()
  {
    parent::setupInheritance();

    $this->widgetSchema   ['widget_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Widget'), 'add_empty' => true));
    $this->validatorSchema['widget_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Widget'), 'required' => false));

    $this->widgetSchema   ['placeholder_name'] = new sfWidgetFormInputText();
    $this->validatorSchema['placeholder_name'] = new sfValidatorString(array('max_length' => 255, 'required' => false));

    $this->widgetSchema   ['pinned'] = new sfWidgetFormInputCheckbox();
    $this->validatorSchema['pinned'] = new sfValidatorBoolean(array('required' => false));

    $this->widgetSchema   ['section_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Section'), 'add_empty' => true));
    $this->validatorSchema['section_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Section'), 'required' => false));

    $this->widgetSchema   ['slug'] = new sfWidgetFormInputText();
    $this->validatorSchema['slug'] = new sfValidatorString(array('max_length' => 255, 'required' => false));

    $this->widgetSchema   ['template_name'] = new sfWidgetFormInputText();
    $this->validatorSchema['template_name'] = new sfValidatorString(array('max_length' => 255, 'required' => false));

    $this->widgetSchema   ['position'] = new sfWidgetFormInputText();
    $this->validatorSchema['position'] = new sfValidatorInteger(array('required' => false));

    $this->widgetSchema->setNameFormat('widget_position[%s]');
  }

  public function getModelName()
  {
    return 'WidgetPosition';
  }

}
